package com.example.demo.enums;


import lombok.Getter;

@Getter
public enum ProcessorEnum {
    PRE_PROCESSOR_TYPE("前置处理器",0),
    POST_PROCESSORS_TYPE("后置处理器",1);

    private String name;
    private Integer value;
    ProcessorEnum(String name, int value) {
        this.name = name;
        this.value = value;
    }
    public static ProcessorEnum valueOfType(int type) {
        switch (type) {
            case 0:
                return PRE_PROCESSOR_TYPE;
            case 1:
                return POST_PROCESSORS_TYPE;
            default:
                return null;
        }

    }

    public static Integer stringOfType(int type) {
        switch (type) {
            case 0:
                return PRE_PROCESSOR_TYPE.getValue();
            case 1:
                return POST_PROCESSORS_TYPE.getValue();
            default:
                return null;
        }
    }

}
